\(\int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx\) [118]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 123 \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=-\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2}+\frac {d \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f} \]

[Out]

-2/3*d*ln(cosh(1/2*f*x+1/2*e))/a^2/f^2+1/6*d*sech(1/2*f*x+1/2*e)^2/a^2/f^2+1/3*(d*x+c)*tanh(1/2*f*x+1/2*e)/a^2
/f+1/6*(d*x+c)*sech(1/2*f*x+1/2*e)^2*tanh(1/2*f*x+1/2*e)/a^2/f

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3399, 4270, 4269, 3556} \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {d \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}-\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2} \]

[In]

Int[(c + d*x)/(a + a*Cosh[e + f*x])^2,x]

[Out]

(-2*d*Log[Cosh[e/2 + (f*x)/2]])/(3*a^2*f^2) + (d*Sech[e/2 + (f*x)/2]^2)/(6*a^2*f^2) + ((c + d*x)*Tanh[e/2 + (f
*x)/2])/(3*a^2*f) + ((c + d*x)*Sech[e/2 + (f*x)/2]^2*Tanh[e/2 + (f*x)/2])/(6*a^2*f)

Rule 3399

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 4270

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(-b^2)*(c + d*x)*Cot[e + f*x]
*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (Dist[b^2*((n - 2)/(n - 1)), Int[(c + d*x)*(b*Csc[e + f*x])^(n -
 2), x], x] - Simp[b^2*d*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x]) /; FreeQ[{b, c, d, e, f}, x] &&
 GtQ[n, 1] && NeQ[n, 2]

Rubi steps \begin{align*} \text {integral}& = \frac {\int (c+d x) \csc ^4\left (\frac {1}{2} (i e+\pi )+\frac {i f x}{2}\right ) \, dx}{4 a^2} \\ & = \frac {d \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}+\frac {\int (c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{6 a^2} \\ & = \frac {d \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f}-\frac {d \int \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{3 a^2 f} \\ & = -\frac {2 d \log \left (\cosh \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{3 a^2 f^2}+\frac {d \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f^2}+\frac {(c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{3 a^2 f}+\frac {(c+d x) \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )}{6 a^2 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.70 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.93 \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=\frac {\cosh \left (\frac {1}{2} (e+f x)\right ) \left (-2 d \cosh \left (\frac {3}{2} (e+f x)\right ) \log \left (\cosh \left (\frac {1}{2} (e+f x)\right )\right )+\cosh \left (\frac {1}{2} (e+f x)\right ) \left (2 d-6 d \log \left (\cosh \left (\frac {1}{2} (e+f x)\right )\right )\right )+f (c+d x) \left (3 \sinh \left (\frac {1}{2} (e+f x)\right )+\sinh \left (\frac {3}{2} (e+f x)\right )\right )\right )}{3 a^2 f^2 (1+\cosh (e+f x))^2} \]

[In]

Integrate[(c + d*x)/(a + a*Cosh[e + f*x])^2,x]

[Out]

(Cosh[(e + f*x)/2]*(-2*d*Cosh[(3*(e + f*x))/2]*Log[Cosh[(e + f*x)/2]] + Cosh[(e + f*x)/2]*(2*d - 6*d*Log[Cosh[
(e + f*x)/2]]) + f*(c + d*x)*(3*Sinh[(e + f*x)/2] + Sinh[(3*(e + f*x))/2])))/(3*a^2*f^2*(1 + Cosh[e + f*x])^2)

Maple [A] (verified)

Time = 0.20 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.67

method result size
parallelrisch \(\frac {4 \ln \left (1-\tanh \left (\frac {e}{2}+\frac {f x}{2}\right )\right ) d -\left (d x +c \right ) f \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )^{3}-d \tanh \left (\frac {e}{2}+\frac {f x}{2}\right )^{2}+3 \tanh \left (\frac {e}{2}+\frac {f x}{2}\right ) f \left (d x +c \right )+2 d x f}{6 f^{2} a^{2}}\) \(82\)
risch \(\frac {2 d x}{3 f \,a^{2}}+\frac {2 d e}{3 f^{2} a^{2}}-\frac {2 \left (3 \,{\mathrm e}^{f x +e} d f x +3 \,{\mathrm e}^{f x +e} c f +d x f -{\mathrm e}^{2 f x +2 e} d +c f -{\mathrm e}^{f x +e} d \right )}{3 f^{2} a^{2} \left (1+{\mathrm e}^{f x +e}\right )^{3}}-\frac {2 d \ln \left (1+{\mathrm e}^{f x +e}\right )}{3 f^{2} a^{2}}\) \(108\)

[In]

int((d*x+c)/(a+a*cosh(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/6*(4*ln(1-tanh(1/2*e+1/2*f*x))*d-(d*x+c)*f*tanh(1/2*e+1/2*f*x)^3-d*tanh(1/2*e+1/2*f*x)^2+3*tanh(1/2*e+1/2*f*
x)*f*(d*x+c)+2*d*x*f)/f^2/a^2

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 385 vs. \(2 (95) = 190\).

Time = 0.25 (sec) , antiderivative size = 385, normalized size of antiderivative = 3.13 \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=\frac {2 \, {\left (d f x \cosh \left (f x + e\right )^{3} + d f x \sinh \left (f x + e\right )^{3} + {\left (3 \, d f x + d\right )} \cosh \left (f x + e\right )^{2} + {\left (3 \, d f x \cosh \left (f x + e\right ) + 3 \, d f x + d\right )} \sinh \left (f x + e\right )^{2} - c f - {\left (3 \, c f - d\right )} \cosh \left (f x + e\right ) - {\left (d \cosh \left (f x + e\right )^{3} + d \sinh \left (f x + e\right )^{3} + 3 \, d \cosh \left (f x + e\right )^{2} + 3 \, {\left (d \cosh \left (f x + e\right ) + d\right )} \sinh \left (f x + e\right )^{2} + 3 \, d \cosh \left (f x + e\right ) + 3 \, {\left (d \cosh \left (f x + e\right )^{2} + 2 \, d \cosh \left (f x + e\right ) + d\right )} \sinh \left (f x + e\right ) + d\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) + 1\right ) + {\left (3 \, d f x \cosh \left (f x + e\right )^{2} - 3 \, c f + 2 \, {\left (3 \, d f x + d\right )} \cosh \left (f x + e\right ) + d\right )} \sinh \left (f x + e\right )\right )}}{3 \, {\left (a^{2} f^{2} \cosh \left (f x + e\right )^{3} + a^{2} f^{2} \sinh \left (f x + e\right )^{3} + 3 \, a^{2} f^{2} \cosh \left (f x + e\right )^{2} + 3 \, a^{2} f^{2} \cosh \left (f x + e\right ) + a^{2} f^{2} + 3 \, {\left (a^{2} f^{2} \cosh \left (f x + e\right ) + a^{2} f^{2}\right )} \sinh \left (f x + e\right )^{2} + 3 \, {\left (a^{2} f^{2} \cosh \left (f x + e\right )^{2} + 2 \, a^{2} f^{2} \cosh \left (f x + e\right ) + a^{2} f^{2}\right )} \sinh \left (f x + e\right )\right )}} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e))^2,x, algorithm="fricas")

[Out]

2/3*(d*f*x*cosh(f*x + e)^3 + d*f*x*sinh(f*x + e)^3 + (3*d*f*x + d)*cosh(f*x + e)^2 + (3*d*f*x*cosh(f*x + e) +
3*d*f*x + d)*sinh(f*x + e)^2 - c*f - (3*c*f - d)*cosh(f*x + e) - (d*cosh(f*x + e)^3 + d*sinh(f*x + e)^3 + 3*d*
cosh(f*x + e)^2 + 3*(d*cosh(f*x + e) + d)*sinh(f*x + e)^2 + 3*d*cosh(f*x + e) + 3*(d*cosh(f*x + e)^2 + 2*d*cos
h(f*x + e) + d)*sinh(f*x + e) + d)*log(cosh(f*x + e) + sinh(f*x + e) + 1) + (3*d*f*x*cosh(f*x + e)^2 - 3*c*f +
 2*(3*d*f*x + d)*cosh(f*x + e) + d)*sinh(f*x + e))/(a^2*f^2*cosh(f*x + e)^3 + a^2*f^2*sinh(f*x + e)^3 + 3*a^2*
f^2*cosh(f*x + e)^2 + 3*a^2*f^2*cosh(f*x + e) + a^2*f^2 + 3*(a^2*f^2*cosh(f*x + e) + a^2*f^2)*sinh(f*x + e)^2
+ 3*(a^2*f^2*cosh(f*x + e)^2 + 2*a^2*f^2*cosh(f*x + e) + a^2*f^2)*sinh(f*x + e))

Sympy [A] (verification not implemented)

Time = 0.48 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.27 \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=\begin {cases} - \frac {c \tanh ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{6 a^{2} f} + \frac {c \tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{2 a^{2} f} - \frac {d x \tanh ^{3}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{6 a^{2} f} + \frac {d x \tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{2 a^{2} f} - \frac {d x}{3 a^{2} f} + \frac {2 d \log {\left (\tanh {\left (\frac {e}{2} + \frac {f x}{2} \right )} + 1 \right )}}{3 a^{2} f^{2}} - \frac {d \tanh ^{2}{\left (\frac {e}{2} + \frac {f x}{2} \right )}}{6 a^{2} f^{2}} & \text {for}\: f \neq 0 \\\frac {c x + \frac {d x^{2}}{2}}{\left (a \cosh {\left (e \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e))**2,x)

[Out]

Piecewise((-c*tanh(e/2 + f*x/2)**3/(6*a**2*f) + c*tanh(e/2 + f*x/2)/(2*a**2*f) - d*x*tanh(e/2 + f*x/2)**3/(6*a
**2*f) + d*x*tanh(e/2 + f*x/2)/(2*a**2*f) - d*x/(3*a**2*f) + 2*d*log(tanh(e/2 + f*x/2) + 1)/(3*a**2*f**2) - d*
tanh(e/2 + f*x/2)**2/(6*a**2*f**2), Ne(f, 0)), ((c*x + d*x**2/2)/(a*cosh(e) + a)**2, True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 239 vs. \(2 (95) = 190\).

Time = 0.22 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.94 \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=\frac {2}{3} \, d {\left (\frac {f x e^{\left (3 \, f x + 3 \, e\right )} + {\left (3 \, f x e^{\left (2 \, e\right )} + e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )} + e^{\left (f x + e\right )}}{a^{2} f^{2} e^{\left (3 \, f x + 3 \, e\right )} + 3 \, a^{2} f^{2} e^{\left (2 \, f x + 2 \, e\right )} + 3 \, a^{2} f^{2} e^{\left (f x + e\right )} + a^{2} f^{2}} - \frac {\log \left ({\left (e^{\left (f x + e\right )} + 1\right )} e^{\left (-e\right )}\right )}{a^{2} f^{2}}\right )} + \frac {2}{3} \, c {\left (\frac {3 \, e^{\left (-f x - e\right )}}{{\left (3 \, a^{2} e^{\left (-f x - e\right )} + 3 \, a^{2} e^{\left (-2 \, f x - 2 \, e\right )} + a^{2} e^{\left (-3 \, f x - 3 \, e\right )} + a^{2}\right )} f} + \frac {1}{{\left (3 \, a^{2} e^{\left (-f x - e\right )} + 3 \, a^{2} e^{\left (-2 \, f x - 2 \, e\right )} + a^{2} e^{\left (-3 \, f x - 3 \, e\right )} + a^{2}\right )} f}\right )} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e))^2,x, algorithm="maxima")

[Out]

2/3*d*((f*x*e^(3*f*x + 3*e) + (3*f*x*e^(2*e) + e^(2*e))*e^(2*f*x) + e^(f*x + e))/(a^2*f^2*e^(3*f*x + 3*e) + 3*
a^2*f^2*e^(2*f*x + 2*e) + 3*a^2*f^2*e^(f*x + e) + a^2*f^2) - log((e^(f*x + e) + 1)*e^(-e))/(a^2*f^2)) + 2/3*c*
(3*e^(-f*x - e)/((3*a^2*e^(-f*x - e) + 3*a^2*e^(-2*f*x - 2*e) + a^2*e^(-3*f*x - 3*e) + a^2)*f) + 1/((3*a^2*e^(
-f*x - e) + 3*a^2*e^(-2*f*x - 2*e) + a^2*e^(-3*f*x - 3*e) + a^2)*f))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 192 vs. \(2 (95) = 190\).

Time = 0.29 (sec) , antiderivative size = 192, normalized size of antiderivative = 1.56 \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=\frac {2 \, {\left (d f x e^{\left (3 \, f x + 3 \, e\right )} + 3 \, d f x e^{\left (2 \, f x + 2 \, e\right )} - 3 \, c f e^{\left (f x + e\right )} - d e^{\left (3 \, f x + 3 \, e\right )} \log \left (e^{\left (f x + e\right )} + 1\right ) - 3 \, d e^{\left (2 \, f x + 2 \, e\right )} \log \left (e^{\left (f x + e\right )} + 1\right ) - 3 \, d e^{\left (f x + e\right )} \log \left (e^{\left (f x + e\right )} + 1\right ) - c f + d e^{\left (2 \, f x + 2 \, e\right )} + d e^{\left (f x + e\right )} - d \log \left (e^{\left (f x + e\right )} + 1\right )\right )}}{3 \, {\left (a^{2} f^{2} e^{\left (3 \, f x + 3 \, e\right )} + 3 \, a^{2} f^{2} e^{\left (2 \, f x + 2 \, e\right )} + 3 \, a^{2} f^{2} e^{\left (f x + e\right )} + a^{2} f^{2}\right )}} \]

[In]

integrate((d*x+c)/(a+a*cosh(f*x+e))^2,x, algorithm="giac")

[Out]

2/3*(d*f*x*e^(3*f*x + 3*e) + 3*d*f*x*e^(2*f*x + 2*e) - 3*c*f*e^(f*x + e) - d*e^(3*f*x + 3*e)*log(e^(f*x + e) +
 1) - 3*d*e^(2*f*x + 2*e)*log(e^(f*x + e) + 1) - 3*d*e^(f*x + e)*log(e^(f*x + e) + 1) - c*f + d*e^(2*f*x + 2*e
) + d*e^(f*x + e) - d*log(e^(f*x + e) + 1))/(a^2*f^2*e^(3*f*x + 3*e) + 3*a^2*f^2*e^(2*f*x + 2*e) + 3*a^2*f^2*e
^(f*x + e) + a^2*f^2)

Mupad [B] (verification not implemented)

Time = 1.69 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.12 \[ \int \frac {c+d x}{(a+a \cosh (e+f x))^2} \, dx=\frac {2\,d}{3\,a^2\,f^2\,\left ({\mathrm {e}}^{e+f\,x}+1\right )}-\frac {2\,\left (d+c\,f+d\,f\,x\right )}{3\,a^2\,f^2\,\left (2\,{\mathrm {e}}^{e+f\,x}+{\mathrm {e}}^{2\,e+2\,f\,x}+1\right )}+\frac {2\,d\,x}{3\,a^2\,f}-\frac {2\,d\,\ln \left ({\mathrm {e}}^{f\,x}\,{\mathrm {e}}^e+1\right )}{3\,a^2\,f^2}-\frac {4\,{\mathrm {e}}^{e+f\,x}\,\left (c+d\,x\right )}{3\,a^2\,f\,\left (3\,{\mathrm {e}}^{e+f\,x}+3\,{\mathrm {e}}^{2\,e+2\,f\,x}+{\mathrm {e}}^{3\,e+3\,f\,x}+1\right )} \]

[In]

int((c + d*x)/(a + a*cosh(e + f*x))^2,x)

[Out]

(2*d)/(3*a^2*f^2*(exp(e + f*x) + 1)) - (2*(d + c*f + d*f*x))/(3*a^2*f^2*(2*exp(e + f*x) + exp(2*e + 2*f*x) + 1
)) + (2*d*x)/(3*a^2*f) - (2*d*log(exp(f*x)*exp(e) + 1))/(3*a^2*f^2) - (4*exp(e + f*x)*(c + d*x))/(3*a^2*f*(3*e
xp(e + f*x) + 3*exp(2*e + 2*f*x) + exp(3*e + 3*f*x) + 1))